package com.itelecom.oss.mobile.views;

import java.util.ArrayList;
import java.util.List;

import com.itelecom.oss.mobile.domains.DeviceForMobile;
import com.itelecom.oss.mobile.services.LoginService;

public class LoginView {
	private String login;
	private String password;
	private LoginService loginService;
	private String[] devices = new String[]{"","",""};
	
	
	public LoginView(String login, String password){
		setLogin(login);
		setPassword(password);
		loginService=new LoginService(login,password);
//		devices=new String[] {
//		        "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra",
//		        "Angola", "Anguilla", "Antarctica"};
		
	}
	
	public String[] getDevices(){
//			new String[1000];
//		DeviceForMobile[] devicesForMobile = new DeviceForMobile[1000];
//		List<DeviceForMobile> devicesForMobile=loginService.getDevices();
//		for(int i=0;devicesForMobile.iterator().hasNext();i++){
//			devices[i]=devicesForMobile.iterator().next().toString();
//			
//		}
		List<DeviceForMobile> devs= loginService.getDevices();
		for(int i=0;i<devs.size();i++)
			devices[i] = devs.get(i).toString();
		
			return devices;
	}
	

	
	public Boolean check(){
		return getLoginService().check();
	}
	private void setLogin(String login) {
		this.login = login;
	}
	private String getLogin() {
		return login;
	}
	private void setPassword(String password) {
		this.password = password;
	}
	private String getPassword() {
		return password;
	}

	private void setLoginService(LoginService loginService) {
		this.loginService = loginService;
	}

	private LoginService getLoginService() {
		return loginService;
	}
	
	

}
